import type {ReducerActionType} from "@/types/commonType.ts";
import type {LoginStateType} from "@/types/loginType.ts";

export const loginReducer = (state: LoginStateType, action: ReducerActionType) => {
    switch (action.type) {
        case 'USER':
            return {
                ...state,
                ...action.payload
            }

        case "PASSWORD":
            return {
                ...state,
                ...action.payload
            }

        default:
            return state
    }
}